﻿using UnityEngine.Serialization;

namespace UI
{
    /// <summary>
    /// 窗口基类
    /// </summary>
    public class WindowBase : Unit
    {
        /// <summary>
        /// 运行时类型
        /// </summary>
        public ShowStatusType showStatusType;

        protected virtual void InitWnd(params object[] objs)
        {
        }

        protected virtual void UnInitWnd()
        {
        }

        public virtual void Show(params object[] objs)
        {
            gameObject.SetActive(true);
            InitWnd(objs);
        }

        public virtual void Close()
        {
            gameObject.SetActive(false);
            UnInitWnd();
        }
    }

    /// <summary>
    /// 运行时类型
    /// </summary>
    public enum ShowStatusType
    {
        PERSISTENCE = 1,
        NON_PERSISTENCE = 2,
    }
}